<?php 
include_once 'lib/config.php';
include_once 'lib/db.php';
include_once 'lib/utils/date.php';
include_once 'model/perbuatan.php';
include_once 'model/prestasipelanggaran.php';
include_once 'model/detil_prestasipelanggaran.php';
include_once 'model/pelapor.php';

function inject_head(){
	?>
<link rel="stylesheet" type="text/css" href="css/datepicker_vista.css" />
<script>
	function changePassword($karyID){
		FBModal_show2( 'proc/client/dataUser.php', 'post', "proc=change-password&karyID="+$karyID, true, true);
	}

	function savePassword(form){
		form.opass.value = form.opass.value;//hex_md5(form.opass.value).toLowerCase();
		form.npass.value = form.npass.value;//hex_md5(form.npass.value).toLowerCase();
		form.npass2.value = form.npass2.value;//hex_md5(form.npass2.value).toLowerCase();
		FBModal_loading("Save", "Please wait...", true, false);
		$(form).set('send', {
			method: 'post',
			onSuccess: function(response) { 
				var js = JSON.decode(response);
				var msg = js.error? js.msg : "Process simpan selesai !!!";
				var title = js.error? 'Error' : 'Saving';
				FBModal_show(
					"<h2 class=\"dialog_title\"><span>"+title+"</span></h2>" + 
					"<div class=\"dialog_content\" style=\"padding: 10px 20px\">"+msg+"</div>",
					true, true,1500);
			}
		}).send();
	}
	
	window.addEvent('domready', function(){});
</script>
<script type="text/javascript" src="jscript/datepicker.js"></script>
	<?php 
	if (function_exists('_inject_head')){
		_inject_head();
	}
}

$sub = $_REQUEST['sub'];
if ($sub === 'perbuatan_add'){
	include 'view/header.php';
	include_once 'model/prestasipelanggaran.php';
	include_once 'model/detil_prestasipelanggaran.php';
	include 'view/client/perbuatan/perbuatan_add.php';
	include 'view/footer.php';
}
else if ($sub === 'preview'){
	include 'view/client/perbuatan/perbuatan_dokumen_enlarge.php';
}
else{
	include 'view/header.php';
	include 'view/client/perbuatan/perbuatan.php';
	include 'view/footer.php';
}